//
//  SonTableViewCell2.m
//  QuickCure
//
//  Created by 雪中狼 on 9/13/16.
//  Copyright © 2016 haoge. All rights reserved.
//

#import "SonTableViewCell2.h"

@interface SonTableViewCell2()<UITextViewDelegate>

@end

@implementation SonTableViewCell2
-(instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
    
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        [self setupUI];
    }
    return self;

    
    
}
-(void)setupUI{
    UILabel *describeLabel =[[UILabel alloc]init];
    [self.contentView addSubview:describeLabel];
    describeLabel.text = @"病症描述";
    [describeLabel makeConstraints:^(MASConstraintMaker *make) {
        make.top.leading.equalTo(self.contentView).offset(20);
    }];
    
    UITextView *textView = [[UITextView alloc]init];
    textView.backgroundColor = [UIColor lightGrayColor];
    textView.scrollEnabled = NO;
    textView.delegate = self;
    [self.contentView addSubview:textView];
    [textView makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(describeLabel.bottom).offset(15);
        make.leading.equalTo(self.contentView).offset(20);
        make.trailing.equalTo(self.contentView).offset(-20);
        make.bottom.equalTo(self.contentView).offset(-20);
        make.height.equalTo(100);
    }];


}
//- (void)textViewDidEndEditing:(UITextView *)textView{

//    if (_describeBlock) {
//        _describeBlock(textView.text);
//    }
//}
-(void)textViewDidChange:(UITextView *)textView{


    if (_describeBlock) {
        _describeBlock(textView.text);
    }

}


@end
